import request from '@/utils/request'

export default{
    // 教师列表（条件查询带分页）
    //getTeacherListPage(当前页，页面大小，查询条件)
    getTeacherListPage(current,size,searchTeacher){
        return request({
            // url: '/eduservice/study-teacher/pageTeacherWrapper/'+current+'/'+size,
            url:`/eduservice/study-teacher/pageTeacherWrapper/${current}/${size}`,
            method: 'post',
            data: {//后端RequestBody获取数据，前端使用data转化json传递到接口
                // name: searchTeacher.name,
                // level: searchTeacher.level,
                // create: searchTeacher.create,
                // end: searchTeacher.end
                ...searchTeacher
            }
            //data:searchTeacher
        })
    },
    //删除教师
    deleteTeacherById(id){
        return request({
            // url: '/eduservice/study-teacher/pageTeacherWrapper/'+current+'/'+size,
            url:`/eduservice/study-teacher/delete/${id}`,
            method: 'delete'
        })
    },
    //添加教师
    saveTeacher(teacher){
        return request({
            url:`/eduservice/study-teacher/addTeacher`,
            method: 'post',
            data: {//后端RequestBody获取数据，前端使用data转化json传递到接口
                // name: searchTeacher.name,
                // level: searchTeacher.level,
                // create: searchTeacher.create,
                // end: searchTeacher.end
                ...teacher
            }
            //data:searchTeacher
        })
    },
    //根据id查询教师
    getById(id){
        return request({
            url:`/eduservice/study-teacher/findTeacher/${id}`,
            method: 'get'
        })
    },
    //修改教师
    updateTeacher(teacher){
        return request({
            url:`/eduservice/study-teacher/updateTeacher`,
            method: 'post',
            data:teacher
        })
    },
    //查询所有教师
    getAllTeacher(){
        return request({
            url:`/eduservice/study-teacher/findAllTeacher`,
            method: 'get'
        })
    }
}
